/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.dp.vo;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;

/**
 *
 * @author wyr
 */
@Entity
@Table(name = "t_phonenoseg")
//@NamedQueries({@NamedQuery(name = "TPhonenoseg.findAll", query = "SELECT t FROM TPhonenoseg t"), @NamedQuery(name = "TPhonenoseg.findByAreaid", query = "SELECT t FROM TPhonenoseg t WHERE t.tPhonenosegPK.areaid = :areaid"), @NamedQuery(name = "TPhonenoseg.findByCarriertype", query = "SELECT t FROM TPhonenoseg t WHERE t.tPhonenosegPK.carriertype = :carriertype"), @NamedQuery(name = "TPhonenoseg.findByPhonenoseg", query = "SELECT t FROM TPhonenoseg t WHERE t.tPhonenosegPK.phonenoseg = :phonenoseg"), @NamedQuery(name = "TPhonenoseg.findBySimtype", query = "SELECT t FROM TPhonenoseg t WHERE t.simtype = :simtype")})
public class TPhonenoseg implements Serializable {
    private static final long serialVersionUID = 1L;
    @EmbeddedId
    protected TPhonenosegPK tPhonenosegPK;
    @Column(name = "simtype")
    private Integer simtype;

    public TPhonenoseg() {
    }

    public TPhonenoseg(TPhonenosegPK tPhonenosegPK) {
        this.tPhonenosegPK = tPhonenosegPK;
    }

    public TPhonenoseg(int areaid, int carriertype, String phonenoseg) {
        this.tPhonenosegPK = new TPhonenosegPK(areaid, carriertype, phonenoseg);
    }

    public TPhonenosegPK getTPhonenosegPK() {
        return tPhonenosegPK;
    }

    public void setTPhonenosegPK(TPhonenosegPK tPhonenosegPK) {
        this.tPhonenosegPK = tPhonenosegPK;
    }

    public Integer getSimtype() {
        return simtype;
    }

    public void setSimtype(Integer simtype) {
        this.simtype = simtype;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (tPhonenosegPK != null ? tPhonenosegPK.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof TPhonenoseg)) {
            return false;
        }
        TPhonenoseg other = (TPhonenoseg) object;
        if ((this.tPhonenosegPK == null && other.tPhonenosegPK != null) || (this.tPhonenosegPK != null && !this.tPhonenosegPK.equals(other.tPhonenosegPK))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.dp.vo.TPhonenoseg[tPhonenosegPK=" + tPhonenosegPK + "]";
    }

}
